package com.example.cloudindex.web.remote;

import com.example.cloudindex.web.vo.Info;
import com.example.cloudindex.web.vo.Type;
import com.example.cloudindex.web.vo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "cloud-order",
    fallback = OrderActionImpl.class)
public interface IOrderAction {

    @RequestMapping("order")
    String order();

    @RequestMapping("hello")
    String hello(@RequestParam String name);

    @RequestMapping("hello/{name}")
    String hello1(@PathVariable String name);

    @RequestMapping("add")
    int add(@RequestParam int a, @RequestParam int b);

    @RequestMapping("user")
    User user(@RequestBody User user);

    @RequestMapping("user1")
    User user1(@RequestBody User user, @RequestParam int age, @RequestParam char gender);

    @RequestMapping("test")
    Map<String,Object> test(@RequestBody Info info);
}
